//计算圆的面积
var circleObj = {
  r: 10,
  pi: 3.14,
  getArea: function () {
    //获取面积
    console.log(this.pi * this.r * this.r);
  }
}
//调用成员方法
circleObj.getArea();

function Cire(r) {
  this.r = r;
  this.pi = 3.14
}

Cire.prototype.getArea = function () {
  return this.r * this.r * this.pi
};

var Cire1 = new Cire(2);

console.log(Cire1.getArea());




